admin: Ensure instutil commands and usage help don't grab lock
authorColin Walters <walters@verbum.org>
Fri, 15 May 2015 12:51:47 +0000 (08:51 -0400)
committerColin Walters <walters@verbum.org>
Fri, 15 May 2015 13:13:50 +0000 (09:13 -0400)
When I was introducing the `_UNLOCKED` flag, I only audited
subcommands of `ostree admin`, but I missed that `ostree admin
instutil` also used the option parsing.  Those are only used by
Anaconda today so we can ignore them for locking purposes.

Also, the usage help generation was grabbing the lock unnecessarily.

src/ostree/ot-admin-instutil-builtin-grub2-generate.c
src/ostree/ot-admin-instutil-builtin-selinux-ensure-labeled.c
src/ostree/ot-admin-instutil-builtin-set-kargs.c
src/ostree/ot-builtin-admin.c

index 5e82d3735deda69507aa5531780285d6d3b4147d..9f31c67a8730b6a4977032ae9c481e56e351f7c6 100644 (file)
@@ -48,7 +48,7 @@ ot_admin_instutil_builtin_grub2_generate (int argc, char **argv, GCancellable *c
   context = g_option_context_new ("[BOOTVERSION] - generate GRUB2 configuration from given BLS entries");
 
   if (!ostree_admin_option_context_parse (context, options, &argc, &argv,
-                                          OSTREE_ADMIN_BUILTIN_FLAG_SUPERUSER,
+                                          OSTREE_ADMIN_BUILTIN_FLAG_SUPERUSER | OSTREE_ADMIN_BUILTIN_FLAG_UNLOCKED,
                                           &sysroot, cancellable, error))
     goto out;
 
index 457e615e88d3497b518c010cb645602453be8481..1f0e91e34af8c37277352b3a97ad1f64c0cbe44a 100644 (file)
@@ -195,7 +195,7 @@ ot_admin_instutil_builtin_selinux_ensure_labeled (int argc, char **argv, GCancel
   context = g_option_context_new ("[SUBPATH PREFIX] - relabel all or part of a deployment");
 
   if (!ostree_admin_option_context_parse (context, options, &argc, &argv,
-                                          OSTREE_ADMIN_BUILTIN_FLAG_SUPERUSER,
+                                          OSTREE_ADMIN_BUILTIN_FLAG_SUPERUSER | OSTREE_ADMIN_BUILTIN_FLAG_UNLOCKED,
                                           &sysroot, cancellable, error))
     goto out;
 
index c3c4968900aaacbe79d261a3e6f5a429a6b37046..c51fc4d265e34904c6ba3de357575937a1f78c94 100644 (file)
@@ -57,7 +57,7 @@ ot_admin_instutil_builtin_set_kargs (int argc, char **argv, GCancellable *cancel
   context = g_option_context_new ("ARGS - set new kernel command line arguments");
 
   if (!ostree_admin_option_context_parse (context, options, &argc, &argv,
-                                          OSTREE_ADMIN_BUILTIN_FLAG_SUPERUSER,
+                                          OSTREE_ADMIN_BUILTIN_FLAG_SUPERUSER | OSTREE_ADMIN_BUILTIN_FLAG_UNLOCKED,
                                           &sysroot, cancellable, error))
     goto out;
 
index cd1e0464aae4284cd82465cf5b4cbd7d6c85c29b..a4cb0dde330d9d915514ca32596d1663d151ea51 100644 (file)
@@ -130,7 +130,7 @@ ostree_builtin_admin (int argc, char **argv, GCancellable *cancellable, GError *
 
       /* This will not return for some options (e.g. --version). */
       if (ostree_admin_option_context_parse (context, NULL, &argc, &argv,
-                                             OSTREE_ADMIN_BUILTIN_FLAG_NONE,
+                                             OSTREE_ADMIN_BUILTIN_FLAG_NONE | OSTREE_ADMIN_BUILTIN_FLAG_UNLOCKED,
                                              NULL, cancellable, error))
         {
           if (subcommand_name == NULL)